<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>
<html>
  <head>
    <base href="<%=basePath%>">
    <%@include file="../common/common.jsp" %>
    <meta charset="UTF-8">
    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 1024px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }
       
    </style>
    <script type="text/javascript" src="js/jquery.form.js"></script>
  </head>
  
  <body>
    <form id="frm" name="frm" action="process/saveCalendarDetail.do" method="post" class="definewidth m20">
		<input type="hidden" id="action" name="action" value="${param.action }" />
		<input type="hidden" id="calendar_id" name="calendar_id" value="${param.calendar_id }" />
		<input type="hidden" id="id" name="id" value="${param.id }">
	    <table class="table table-bordered table-hover definewidth m10">
	        <tr>
	            <td width="10%" class="tableleft">周次</td>
	            <td>
	            	<div class="input-append">
                		<input type="number" name="week" style="height: 26px;" id="week" value="${info.week }"/><span class="add-on">周</span>
              		</div>
              </td>
	        </tr>
	        <tr>
	            <td class="tableleft">讲课</td>
	            <td>
	            	<div class="input-append">
		            	<input type="text" name="course_content" style="height: 26px;" id="course_content" value="${info.course_content }"/>
		            	<span class="add-on">（教学大纲分章和题目的名称）</span>
	            	</div>
	            </td>
	        </tr>
	         <tr>
	           	<td class="tableleft">课堂时数</td>
	            <td><input type="number" name="course_kt_hour" style="height: 26px;" id="course_kt_hour" value="${info.course_kt_hour }"/></td>
	        </tr>
	        <tr>
	           	<td class="tableleft">课外时数</td>
	            <td><input type="number" name="course_kw_hour" style="height: 26px;" id="course_kw_hour" value="${info.course_kw_hour }"/></td>
	        </tr>
	        <tr>
	            <td class="tableleft">习题课</td>
	            <td>
	            	<div class="input-append">
		            	<input type="text" name="test_content" style="height: 26px;" id="test_content" value="${info.test_content }"/>
		            	<span class="add-on">（习题课、课堂讨论、课程练习、测验的内容）</span>
	            	</div>
	            </td>
	        </tr>
	         <tr>
	           	<td class="tableleft">课堂时数</td>
	            <td><input type="number" name="test_kt_hour" style="height: 26px;" id="test_kt_hour" value="${info.test_kt_hour }"/></td>
	        </tr>
	        <tr>
	           	<td class="tableleft">课外时数</td>
	            <td><input type="number" name="test_kw_hour" style="height: 26px;" id="test_kw_hour" value="${info.test_kw_hour }"/></td>
	        </tr>
	        <tr>
	            <td class="tableleft">实验</td>
	            <td>
	            	<div class="input-append">
	            	<input type="text" name="lab_content" style="height: 26px;" id="lab_content" value="${info.lab_content }"/>
	            	<span class="add-on">（实验名称、课程作业、作图、课程设计的名称及现场教学）</span>
	            	</div>
	            </td>
	        </tr>
	         <tr>
	           	<td class="tableleft">课堂时数</td>
	            <td><input type="number" name="lab_kt_hour" style="height: 26px;" id="lab_kt_hour" value="${info.lab_kt_hour }"/></td>
	        </tr>
	        <tr>
	           	<td class="tableleft">课外时数</td>
	            <td><input type="number" name="lab_kw_hour" style="height: 26px;" id="lab_kw_hour" value="${info.lab_kw_hour }"/></td>
	        </tr>
	        <tr>
	            <td class="tableleft">书籍</td>
	            <td>
	            	<div class="input-append">
	            	<textarea rows="5" cols="40" name="books" style="height: 26px;" id="books" >${info.books }</textarea>
	            	<span class="add-on">必读书籍和参考书目</span>
	            	</div>
	            </td>
	        </tr>
	        <tr>
	            <td class="tableleft"></td>
	            <td>
	                <button type="button" class="btn btn-primary" id="btnSave" type="button">保存</button>				 &nbsp;&nbsp;
	                <button type="button" class="btn btn-success" id="btnBack">返回列表</button>
	            </td>
	        </tr>
	    </table>
	</form>
  </body>
</html>
<script>
    $(function () {
    	$("#btnBack").click(function (){
    		window.history.back(-1);
    	});
		$('#btnSave').click(function(){
			var v=true;
// 			$(":text").each(function (){
// 				var _this=$(this);
// 				if(_this.val()==''){
// 					_this.addClass("error")
// 					v=false;
// 				}
// 			});
// 			if(v!=true){
// 				alert("您录入的参数不完整");
// 				return;
// 			}
			$(this).addClass("disabled")
			var str=$('#frm').formSerialize();
			$.post("process/saveCalendarDetail.do",str,function (a,b){
				$(this).removeClass("disabled")
	    		if(b=='success'){
	    			var msg=a.msg;
	    			alert(msg)
	    			if(msg=='保存成功'){
	    				var calendar_id=$("#calendar_id").val();
	    				var action=$("#action").val();
	    				document.frm.action="<%=basePath%>process/queryCalendarDetail.do?calendar_id="+calendar_id+"&action="+action;
	    				document.frm.submit();
	    			}
	    		}
	    	});
		});
    });    
</script>